//
//  CouModel.m
//  tabbar
//
//  Created by KWSD on 16/5/18.

//  Copyright © 2016年 孙添凤. All rights reserved.reterertetretretrertert
//

#import "CouModel.h"

@implementation CouModel
+(JSONKeyMapper*)keyMapper {
    
    /* 注意JuhuiModel里面需要映射2种类型
     1. 驼峰Camel命名规范
     2. 把author.header_img和author_username要映射到JuhuiModel直接字段里面 */
    JSONKeyMapper *mapper = [JSONKeyMapper mapperFromUnderscoreCaseToCamelCase];
    // 取得影射的blocks对象
    JSONModelKeyMapBlock modelBlock = mapper.modelToJSONKeyBlock;
    
    // 根据上述的重新创建映射条件
    JSONKeyMapper *newMapper = [[JSONKeyMapper alloc] initWithJSONToModelBlock:nil modelToJSONBlock:^NSString *(NSString *keyName) {
        // 告诉我们影射规律
        if ([keyName isEqualToString:@"appoint"]) {//时间戳：1470110400000  2016/8/2 12:0:0
            return @"START_TIME";
        } else if ([keyName isEqualToString:@"name"]) {//显示的课程名称
            return @"SHOW_CONTENT";
        } else if ([keyName isEqualToString:@"teacher"]) {
            return @"AFM_47";
        } else if ([keyName isEqualToString:@"time"]) {
            return @"AFM_48";
        }else if ([keyName isEqualToString:@"start"]) {
            
            return @"AFM_7";
        }else if ([keyName isEqualToString:@"end"]) {
            
            return @"AFM_8";
        }else if ([keyName isEqualToString:@"appointHour"]) {
            
            return @"AFM_10";
        }else if ([keyName isEqualToString:@"mockMachine"]) {
            
            return @"AFM_52";
        }else if ([keyName isEqualToString:@"dudaocishu"]) {
            
            return @"AFM_56";
        }else if ([keyName isEqualToString:@"stuName"]) {
            
            return @"AFM_64";
        }else if ([keyName isEqualToString:@"comlateHomeWork"]) {
            
            return @"AFM_65";
        }
        else if ([keyName isEqualToString:@"homeWorkScore"]) {
            
            return @"AFM_67";
        }
        else if ([keyName isEqualToString:@"comlateHomeWork"]) {
            
            return @"AFM_65";
        }
        else if ([keyName isEqualToString:@"stage"]) {
            
            return @"AFM_20";
        }
        else if ([keyName isEqualToString:@"state"]) {
            
            return @"DIC_AFM_11";
        }
        else if ([keyName isEqualToString:@"userHour"]) {
            
            return @"AFM_51";
        }else if ([keyName isEqualToString:@"firstTest"]) {
            
            return @"AFM_61";
        }
        else if ([keyName isEqualToString:@"teacherToPar"]) {
            
            return @"AFM_75";
        }
        else if ([keyName isEqualToString:@"teacherToStu"]) {
            
            return @"DIC_AFM_73";
        }
        else if ([keyName isEqualToString:@"school"]) {
            
            return @"AFM_49";
        }
        else if ([keyName isEqualToString:@"homeWorkMark"]) {
            
            return @"AFM_71";
        }
        else if ([keyName isEqualToString:@"homeState"]) {
            
            return @"DIC_AFM_70";
        }
        else if ([keyName isEqualToString:@"pingjia"]) {
            
            return @"DIC_AFM_63";
        }
        else if ([keyName isEqualToString:@"classContent"]) {
            
            return @"AFM_74";
        }
        else if ([keyName isEqualToString:@"stuToTeacher"]) {
            
            return @"AFM_77";
        }
        else if ([keyName isEqualToString:@"stuToClass"]) {
            
            return @"DIC_AFM_76";
        }
        else if ([keyName isEqualToString:@"ifClassPlan"]) {
            
            return @"DIC_AFM_72";
        }
        else if ([keyName isEqualToString:@"ifHandUphome"]) {
            
            return @"DIC_AFM_66";
        }
        else if ([keyName isEqualToString:@"version"]) {
            
            return @"DIC_AFM_50";
        }
        else if ([keyName isEqualToString:@"mockScore"]) {
            
            return @"AFM_53";
        }
        else if ([keyName isEqualToString:@"mockback"]) {
            
            return @"AFM_54";
        }
        else if ([keyName isEqualToString:@"dudao"]) {
            
            return @"DIC_AFM_57";
        }
        else if ([keyName isEqualToString:@"dudaoNum"]) {
            
            return @"AFM_56";
        }
        else if ([keyName isEqualToString:@"ifdudao"]) {
            
            return @"DIC_AFM_58";
        }
        else if ([keyName isEqualToString:@"dudaoScore"]) {
            
            return @"AFM_59";
        }
        else if ([keyName isEqualToString:@"dudaoBack"]) {
            
            return @"AFM_60";
        }else if ([keyName isEqualToString:@"classtype"]) {
            
            return @"DIC_AFM_79";
        }else if ([keyName isEqualToString:@"homeWorkWanccheng"]) {
            
            return @"AFM_68";
        }
        else if ([keyName isEqualToString:@"HomeWorkPiGai"]) {
            
            return @"AFM_69";
        }else if ([keyName isEqualToString:@"startTime"]) {//课程开始时间
            
            return @"START_TIME";
        }
        else if ([keyName isEqualToString:@"endTime"]) {//课程结束时间
            
            return @"END_TIME";
        }else if ([keyName isEqualToString:@"CHAPTER_DESCRIBE"]) {//
            
            return @"CHAPTER_DESCRIBE";
        }else if ([keyName isEqualToString:@"CHAPTER_NAME"]) {//
            
            return @"CHAPTER_NAME";
        }else if ([keyName isEqualToString:@"CHAPTER_TASK"]) {//
            
            return @"CHAPTER_TASK";
        }else if ([keyName isEqualToString:@"ENGLISH_NAME"]) {//
            
            return @"ENGLISH_NAME";
        }
    
        return modelBlock(keyName);
    }];
    return newMapper;

    
    //return [JSONKeyMapper mapperFromUnderscoreCaseToCamelCase];
}



+(BOOL)propertyIsOptional:(NSString*)propertyName {
    return  YES;
}
@end
